<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>

		<base href="<%=basePath%>">
		<!--[if lte IE 6]></base><![endif]-->
		<title>广东科学技术职业学院考生报到系统<s:property value="%{#session.college.collegesName}"/></title>

		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>

		<link href="css/newindex.css" rel="stylesheet" type="text/css" />
		<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->
		<script src="js/jquery-1.5.js" language="javascript">
</script>
		<script src="js/newpublic.js" language="javascript">
</script>
		<script src="js/table.js" language="javascript">
</script>

	
		<script language="javascript" type="text/javascript"
			src="js/jquery.flot.js">
			
</script>
	
		<!--                     下面是柱状图所要用到的两个文件         -->

		<script language="javascript" type="text/javascript"
			src="js/Bar-chart.js">
</script>

		<!-- 下面是饼图所要用到的两个文件 -->
		<script type="text/javascript" src="js/jquery.flot.pie.min.js">
</script>
		<script type="text/javascript" src="js/Pie-chart.js">
</script>
		<script src="js/jquery-ui-1.8.5.custom.min.js" language="javascript">
</script>
		<script language="javascript">
function s(s) {
	for ( var i = 1; i <= 4; i++)
		$('#t' + i).css('display', 'none');
	$('#t' + s).css('display', 'block');
	index = s;
	fillData(s);
	
}
var index;  //当前显示的div
var registerBarchart = new BarChart();  //专业报道柱状图对象
var paymentBarchart = new BarChart();  //专业缴费柱状图对象
var registerPie = new PieChart();  //学院报道饼图对象
var paymentPie = new PieChart();  //学院缴费饼图对象	

$(function() {
	index = 1;
	fillData(index);
	$("#content").draggable({cancel:".contable"});
	//动态加载logo
	$("#content .subjectlogo").css("background-image","url(<%=basePath%>/newimages/${sessionScope.college.collegeLogo})");
	
})

//填充数据
function fillData(index) {
	showProgressBar(true, index);
	switch(index) {
		case 1:
			$.post("json/CollegeQueryAction!registerInfoPieData",
				function(data) {
				$("#collegeName").html(data.collegeName);
				registerInfoPie = eval("(" + data.registerInfoPie + ")");
				registerPie.buildPieChart($("#placeholderForPie"), registerInfoPie, null);
			})
			break;
		case 2:
			$.post("json/CollegeQueryAction!paymentInfoPieData",
				function(data) {
				$("#collegeName").html(data.collegeName);
				paymentInfoPie = eval("(" + data.paymentInfoPie + ")");
				paymentPie.buildPieChart($("#placeholderForPie2"), paymentInfoPie, null);
			})
			break;
		case 3:
			$.post("json/CollegeQueryAction!professionRegisterBarData",
				function(data) {
				$("#collegeName").html(data.collegeName);
				professionRegisterBar = eval("(" + data.professionRegisterBar + ")");
				registerBarchart.buildBarsChart($("#placeholderForBars"), $("#lengendForBars"), professionRegisterBar);
			})
			break;
		case 4:
			$.post("json/CollegeQueryAction!professionPaymentBarData",
				function(data) {
				$("#collegeName").html(data.collegeName);
				professionPaymentBar = eval("(" + data.professionPaymentBar + ")");
				paymentBarchart.buildBarsChart($("#placeholderForBars2"), $("#lengendForBars2"), professionPaymentBar);
			})
			break;
	}
	showProgressBar(false, index);
}

//更新数据
function update(){
	fillData(index);
}

//显示进度圈，当isShow为false时不显示,true则显示
function showProgressBar(isShow, index) {
	if (isShow) {
		$("#progressBar" + index).show();
	} else {
		$("#progressBar" + index).hide();
	}
}
</script>
	</head>

	<body onload="fixPNGAll()">
		<jsp:include page="common_head.jsp" />
				<div id="content">
					<!--当前位置CSS-->
					<div class="top">
						<div class="topleft">
							<div class="dan">
								<div>
									当前位置>招生概况>院级概况
								</div>
							</div>
							<div class="F5">
								<img src="newimages/F5.png" />
							</div>
						</div>
						<div class="topright">
							<div class="toprightmin"></div>
							<div class="toprightmax"></div>
							<div class="toprightclose" onclick="if(confirm('是否确定退出！')){location.replace('loginoutAction')}" title="点击退出"></div>
						</div>
					</div>
					<!---->
					<!--内容-->
					<div class="condiv">
						<div class="subjectlogo">
							<!--每学院Logo-->
							<div class="submenu">
								<ul>
									<li>
										<a href="scoreStatisticsAction">成绩统计</a>
									</li>
									<li>
										<a href="professionSelectAction">专业概况</a>
									</li>
									<li>
										<a href="yardSelectAction">院级概况</a>
									</li>
									<li>
										<a href="schoolSelectAction">校级概况</a>
									</li>
								</ul>
							</div>
							<div class="contable">
								<div class="contable">
									<div class="title">
										院级概况
									</div>
									<!-- 表格，从数据库读取数据 -->
									<div style="text-align: right; margin-right: 50px;">
										<input id="updateBtn" type="button" value="刷新" onclick="update()" />
									</div>

									<table width="544" border="0" align="center" cellpadding="1"
										cellspacing="5" class="table">
										<tr>
											<td width="147" align="center" style="font-size: 16px;">
												<a href="javascript:s(1)">学院报到率</a>
											</td>
											<td width="95" align="center" style="font-size: 16px;">
												<a href="javascript:s(2)">学院缴费率</a>
											</td>
											<td width="159" align="center" style="font-size: 16px;">
												<a href="javascript:s(3)">各专业报到率</a>
											</td>
											<td width="110" align="center" style="font-size: 16px;">
												<a href="javascript:s(4)">各专业缴费率</a>
											</td>
										</tr>
									</table>



									<table width="80%" border="0" align="center" cellpadding="1"
										cellspacing="5" id="t1">
										<tr>
											<td>
											</td>
										</tr>
										<tr>
											<td style="font-size: 12px; color: red;">
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新生总体报到率
											</td>
										</tr>
										<tr>
											<td align="center">
												<div id="progressBar1" style="display: none">
													<!-- 进度圈 -->
													<center>
														<img src="images/loading.gif" />
													</center>
												</div>
												<div id="placeholderForPie"
													style="width: 600px; height: 300px; float: left"></div>
											</td>
										</tr>
									</table>



									<table width="80%" border="0" align="center" cellpadding="1"
										cellspacing="5" id="t2" style="display: none;">
										<tr>
											<td>
											</td>
										</tr>
										<tr>
											<td style="font-size: 12px; color: red;">
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新生总体缴费率
											</td>
										</tr>
										<tr>
											<td align="center">
												<div id="progressBar2" style="display: none">
													<!-- 进度圈 -->
													<center>
														<img src="images/loading.gif" />
													</center>
												</div>
												<div id="placeholderForPie2"
													style="width: 600px; height: 300px; float: left"></div>
											</td>
										</tr>
									</table>




									<table width="80%" border="0" align="center" cellpadding="1"
										cellspacing="5" id="t3" style="display: none;">
										<tr>
											<td>
											</td>
										</tr>
										<tr>
											<td style="font-size: 12px; color: red;">
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;各专业报到率
											</td>
										</tr>
										<tr>
											<td align="center">
												<div id="progressBar3" style="display: none">
													<!-- 进度圈 -->
													<center>
														<img src="images/loading.gif" />
													</center>
												</div>
												<div id="placeholderForBars"
													style="width: 500px; height: 300px; float: left;"></div>
												<div id="lengendForBars" style="float: right; width: 150px"></div>
											</td>
										</tr>
									</table>


									<table width="80%" border="0" align="center" cellpadding="1"
										cellspacing="5" id="t4" style="display: none;">
										<tr>
											<td>
											</td>
										</tr>
										<tr>
											<td style="font-size: 12px; color: red;">
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;各专业缴费率
											</td>
										</tr>
										<tr>
											<td align="center">
												<div id="progressBar4" style="display: none">
													<!-- 进度圈 -->
													<center>
														<img src="images/loading.gif" />
													</center>
												</div>
												<div id="placeholderForBars2"
													style="width: 500px; height: 300px; float: left;"></div>
												<div id="lengendForBars2" style="float: right; width: 150px"></div>
											</td>
										</tr>
									</table>
									<!-- 表格，从数据库读取数据结束 -->
								</div>
							</div>
						</div>
					</div>
					<!---->
					<!---->
					<div class="condiv"
						style="width: 997px; position: relative; height: 20px; min-height: 20px; text-align: center;">
						<a href="computer/computer.html" target="_blank">计算机学院程序员之家</a>
					</div>
					<!---->
					<!--低部-->
					<div class="bottom">
						&nbsp;
					</div>
					<!---->
				</div>
			</div>
		</div>
	</body>
</html>
